<?php

namespace App\Helpers\Lib;

use GuzzleHttp\Client;

class Shiyi
{
    public static $base_uri = "https://s5k.cn/";
    public static function shiyi_api(){
        $client = new Client([
            // Base URI is used with relative requests
            'base_uri' => self::$base_uri,
            // You can set any number of default request options.
            'timeout'  => 2.0,
        ]);
        $res = $client->post('/api/v1/studio/Kwai-Kolors/Kolors-Virtual-Try-On/gradio',[
            'headers'=>[
                'token'=>'cfc7590c-1a5a-4bbd-9750-60b1786bd756',
                'referer'=>'https://s5k.cn/inner/studio/gradio?backend_url=/api/v1/studio/Kwai-Kolors/Kolors-Virtual-Try-On/gradio/&sdk_version=4.38.1&t=1732691443055&__theme=light&studio_token=cfc7590c-1a5a-4bbd-9750-60b1786bd756'
            ],
            'data'=>[
                'clothImage'=>'https://s5k.cn/api/v1/studio/Kwai-Kolors/Kolors-Virtual-Try-On/gradio/file=/tmp/gradio/9204e4e7f7919583ebb6f3b988e5cbb0ca1d9f7c/000.png',
                'garment_img'=>'https://s5k.cn/api/v1/studio/Kwai-Kolors/Kolors-Virtual-Try-On/gradio/file=/tmp/gradio/aa093148c95458f5221006714259fc3a1131951f/02_upper.png'
            ],
        ]);
        $resArr = json_decode($res->getBody(),true);
        var_dump($resArr);
    }
}
